/// @tags:
#include <cstdio>
#include <functional>
#include <iostream>
#include <numeric>

using std::cin, std::cout, std::endl;

namespace BlueQuantum {

constexpr int maxn = 1e5, maxc = 26;

struct SegmentTree {
  int val[maxn * 4 + 1];

  void modify(int u, int l, int r, int pos, int v) {
    if (l == r) {
      val[u] += v;
      return;
    }
    int mid = (l + r) >> 1;
    if (pos <= mid)
      modify(u << 1, l, mid, pos, v);
    else
      modify(u << 1 | 1, mid + 1, r, pos, v);
    val[u] = val[u << 1] + val[u << 1 | 1];
  }

  int query(int u, int l, int r, int L, int R) {
    if (L <= l && r <= R) return val[u];
    int mid = (l + r) >> 1, ans = 0;
    if (L <= mid) ans += query(u << 1, l, mid, L, R);
    if (mid < R) ans += query(u << 1 | 1, mid + 1, r, L, R);
    return ans;
  }
} segt[maxc];

char str[maxn + 1];

int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> str[i];
    segt[str[i] - 'a'].modify(1, 1, n, i, 1);
  }
  int q;
  cin >> q;
  while (q--) {
    int opt, x, l, r;
    char c;
    cin >> opt;
    if (opt == 1) {
      cin >> x >> c;
      segt[str[x] - 'a'].modify(1, 1, n, x, -1);
      segt[c - 'a'].modify(1, 1, n, x, 1);
      str[x] = c;
    } else {
      cin >> l >> r;
      std::vector<std::pair<int, int>> ans(maxc, {0, 0});
      for (int i = 0; auto &[sub, all] : ans) {
        sub = segt[i].query(1, 1, n, l, r);
        all = segt[i++].query(1, 1, n, 1, n);
      }
      int L = 0, R = 25;
      while (ans[L].first == 0) ++L;
      while (ans[R].first == 0) --R;
      bool flag = true;
      for (int i = l, ch = 0; auto [sub, all] : ans) {
        if (sub != 0) {
          if (i + sub - 1 > n) {
            flag = false;
            break;
          }
          flag &= sub == segt[ch].query(1, 1, n, i, i + sub - 1);
          i = i + sub;
        }
        ch++;
      }
      for (int i = L + 1; i <= R - 1; ++i) {
        auto [sub, all] = ans[i];
        flag &= sub == all;
      }
      cout << (flag ? "Yes\n" : "No\n");
    }
  }
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("F - Substring of Sorted String.in", "r", stdin);
  freopen("F - Substring of Sorted String.out", "w", stdout);
#endif
#endif

  std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
